body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
  background: #020617;
  color: #f9fafb;
}

.app {
  max-width: 1200px; /* wider so sidebar doesn't crowd main content */
  margin: 0 auto;
  padding: 1.5rem;
}

header h1 {
  margin-bottom: 0.25rem;
}

header p {
  color: #9ca3af;
  margin-top: 0;
}

/* ---------- LAYOUT: sidebar + main content ---------- */

.main-layout {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* LEFT: folder sidebar */
.folder-sidebar {
  width: 220px;
  min-width: 200px;
  max-width: 240px;
  padding: 0.75rem 0.75rem 0.75rem 0;
  /* border-right removed so it doesn't cut through "Create" */
}

.folder-sidebar-header h2 {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #9ca3af;
}

/* New folder row */
.folder-create-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.folder-create-row input {
  flex: 1;
  padding: 0.35rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #374151;
  background: #020617;
  color: #f9fafb;
}

.folder-create-row button {
  padding: 0.35rem 0.8rem;
  border-radius: 0.5rem;
  border: none;
  background: #2563eb;
  color: #f9fafb;
  font-size: 0.8rem;
  cursor: pointer;
}

/* Folder list container */
#folderList {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* Individual folder buttons */
.folder-item {
  width: 100%;
  text-align: left;
  border: none;
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  background: #020617;
  border: 1px solid #111827;
  cursor: pointer;
  font-size: 0.9rem;
  color: #d1d5db;
}

.folder-item:hover {
  background: #111827;
}

.folder-item.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #f9fafb;
}

/* "See more" button */
.folder-see-more {
  border: none;
  background: none;
  color: #6b7280;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  cursor: pointer;
}

/* RIGHT: goals + chat column */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;

  /* NEW: move the divider here instead of on the sidebar */
  border-left: 1px solid #1f2937;
  padding-left: 1.5rem; /* pushes main content right so line isn't on top of "Create" */
}

/* ---------- Goals section ---------- */

.goals {
  margin-top: 0; /* main-layout already has margin-top */
}

#goalsInput {
  width: 100%;
  min-height: 70px;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid #374151;
  background: #020617;
  color: inherit;
  resize: vertical;
}

#saveGoalsBtn {
  margin-top: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 0.5rem;
  border: none;
  background: #2563eb;
  color: white;
  cursor: pointer;
}

/* ---------- Chat section ---------- */

.chat {
  border-radius: 0.75rem;
  border: 1px solid #374151;
  background: #020617;
  display: flex;
  flex-direction: column;
  height: 480px;
}

#messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

.message {
  margin-bottom: 0.75rem;
  max-width: 80%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  line-height: 1.4;
}

.message.user {
  margin-left: auto;
  background: #1d4ed8;
}

.message.assistant {
  margin-right: auto;
  background: #111827;
}

.message .role {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.message .text {
  margin-top: 0.25rem;
  white-space: pre-wrap;
}

#chatForm {
  display: flex;
  border-top: 1px solid #374151;
}

#messageInput {
  flex: 1;
  border: none;
  padding: 0.75rem;
  border-radius: 0 0 0 0.75rem;
  background: #020617;
  color: inherit;
}

#messageInput:focus {
  outline: none;
}

#chatForm button {
  border: none;
  padding: 0 1.25rem;
  border-radius: 0 0 0.75rem 0;
  background: #22c55e;
  color: #020617;
  font-weight: 600;
  cursor: pointer;
}
/* Goals listed under each folder in the sidebar */
.folder-goal-list {
  margin-left: 0.75rem;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.folder-goal-item {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 0.8rem;
  text-align: left;
  padding: 0.2rem 0.4rem;
  border-radius: 0.35rem;
  cursor: pointer;
}

.folder-goal-item:hover {
  background: #111827;
  color: #e5e7eb;
}

.folder-goal-item.active-goal {
  background: #1d4ed8;
  color: #f9fafb;
}

/* old dropdown-based folder-row / #folderSelect styles removed */
